Auto merge of #2405 - gkoz:reinstall, r=alexcrichton
authorbors <bors@rust-lang.org>
Mon, 2 May 2016 16:54:56 +0000 (09:54 -0700)
committerbors <bors@rust-lang.org>
Mon, 2 May 2016 16:54:56 +0000 (09:54 -0700)
commit401209f258665ca62989fbf573bfc4f4b3b9eb00
tree5dc8cb8baaeb0fbfc10f1209a19214faadb94e21
parent2d84f3e7dd70929c7f671366cae610e01d8e7ed9
parent9f0fa249b5d307bd97c8c4957a98ad9f47116bf9
Auto merge of #2405 - gkoz:reinstall, r=alexcrichton

Add `--force` flag to cargo install

Close #2082.

Adding `--force` (`-f`) instructs cargo to overwrite existing binaries (updating the metadata accordingly).
This allows updating crates via `cargo install -f <crate>`.

Installation happens in two stages now: binaries are copied into a temporary subdirectory of the destination first, then moved into destination. This should catch some errors earlier.

In case of installation error cargo will remove new binaries but won't attempt to undo successful overwrites.